﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<CourseSystem.Core.Entities.CommonStudyInfo>" %>

<%@ Import Namespace="Chowpoo.Util" %>
<%@ Import Namespace="CourseSystem.Common.Helpers" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    讲授式课件管理
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% Html.RenderPartial("AdminTopUc", "讲授式课件管理"); %>
    <table width="100%" height="5" border="0" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
        <tr>
            <td height="5" bgcolor="#FFFFFF">
            </td>
        </tr>
    </table>
    <% using (Html.BeginForm("CoursewareEdit", "AdminStudy", new { Model.Id, Model.Type, ran = ViewData["ranStr"] }, FormMethod.Post, new { enctype = "multipart/form-data" }))
       {%>
    <fieldset>
        <div class="editor-label">
            <%: Html.LabelFor(model => model.Title) %>
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.Title, new { @class = "longText" })%>
            <%: Html.ValidationMessageFor(model => model.Title)%>
        </div>
        <div class="editor-label">
            <%: Html.Label("上传主文件") %>
        </div>
        <div class="editor-field">
            <%var isVedio = false; if (Model.CommonContentInfo != null && !string.IsNullOrEmpty(Model.CommonContentInfo.DetailContent))
               {
                   isVedio = ResourcesHelper.UploadVideoExt.Contains(
                       CommonUtils.GetFileExt(Model.CommonContentInfo.DetailContent));
                   if (isVedio)
                   {%>
            <%= ResourcesHelper.GetHtml("Upload/Courseware/"+Model.CommonContentInfo.DetailContent, 5) %>
            <% }
                   else
                   { %>
            <a href="<%= StudyHelper.GetCoursewareUrl(Model.CommonContentInfo.DetailContent) %>"
                target="_blank">预览</a>
            <% }
               } %>
            <br />
            <input type="file" name="UpFile" />
            <%: Html.ValidationMessage("UpFile")%>
        </div>
        <% if (!isVedio && !string.IsNullOrEmpty(ViewData["FileDic"].ToString()))
           { %>
        <div class="editor-field red">
            请把其余文件上传至ftp的<%: ViewData["FileDic"]%>文件夹内
        </div>
        <%} %>
        <p>
            <input type="submit" value="保存" /><%=Html.ActionButton("返回", "Courseware")%>
        </p>
    </fieldset>
    <% } %>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeaderContent" runat="server">
</asp:Content>
